package routers

import (
	"github.com/gin-gonic/gin"
	"project1/controllers/admin"
	"project1/middlewares"
)

func AdminRoutersInit(r *gin.Engine) {
	adminRouter := r.Group("/admin", middlewares.InitMiddleware)
	{
		adminRouter.GET("/", admin.IndexController{}.Index)

		adminRouter.GET("/user", admin.UserController{}.Index)

		adminRouter.GET("/user/add", admin.UserController{}.Add)

		adminRouter.POST("/user/upload", admin.UserController{}.Upload)

		adminRouter.GET("/artical", admin.ArticalController{}.Index)

		adminRouter.GET("/artical/add", admin.ArticalController{}.Add)

		adminRouter.GET("/artical/edit", admin.ArticalController{}.Edit)

	}
}
